﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RATSharp.Collection
{
    /// <summary>
    /// Representation of one selectable item in menu.
    /// </summary>
    /// <typeparam name="V">KEY - model with visible representation</typeparam>
    /// <typeparam name="T">ACTION- delegate</typeparam>
    public class MenuItem<V, T>
    {
        /// <summary>
        /// KEY - model with visible representation
        /// </summary>
        public V value { get; private set; }
        /// <summary>
        /// ACTION- delegate
        /// </summary>
        public T menuHandler { get; private set; }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="value">KEY - model with visible representation</param>
        /// <param name="menuHandler">ACTION- delegate</param>
        public MenuItem(V value, T menuHandler)
        {
            this.value = value;
            this.menuHandler = menuHandler;
        }

        /// <summary>
        /// Overriden ToString as we want to shown item in specific format
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return String.Format("{0}", value);
        }
    }
}
